package cn.maihe.elg.operation.model.enums;

import java.util.Arrays;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @Description
 * @Author caixh
 * @Date 2021/8/9.
 */
public enum CustomerAttachmentTypeEnum {

    TYPE_0("0", "营业执照"),
    TYPE_1("1", "开户许可证"),
    TYPE_2("2", "身份证人像面"),
    TYPE_3("3", "身份证国徽面"),
    TYPE_4("4", "企业认证申请表 图片"),
    TYPE_5("5", "合同公章"),
    TYPE_6("6", "企业法人章用章授权委托书 图片"),
    TYPE_7("7", "企业资质文件 图片"),
    ;
    private String type;
    private String desc;

    CustomerAttachmentTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public String getTypeStr() {
        return String.valueOf(type);
    }

    public String getDesc() {
        return desc;
    }

    public static CustomerAttachmentTypeEnum resolve(String type) {
        return Arrays.stream(values()).filter(o -> o.type.equals(type)).findFirst().orElse(null);
    }

    public static Set<CustomerAttachmentTypeEnum> getAll() {
        return Arrays.stream(values()).collect(Collectors.toSet());
    }
}
